{% extends 'layout.html' %}

{% block content %}
    <div class="clearfix" style="margin-bottom: 15px;display: block">
        <a class="btn btn-success" href="/pretty/add/"><span class="glyphicon glyphicon-plus-sign"></span> 新建靓号ModelForm</a>
        <form class="navbar-form navbar-right" style="margin: 0" method="get">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="搜索" name="q" value="{{ search_data }}">
            </div>
            <button type="submit" class="btn btn-default">
                <span class="glyphicon glyphicon-search"></span>
            </button>
        </form>
    </div>
    <div>
        <div class="panel panel-default">
            <div class="panel-heading"><span class="glyphicon glyphicon-list"></span> 靓号管理</div>
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>手机号</th>
                    <th>价格</th>
                    <th>级别</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% for obj in pretty_list %}
                    <tr>
                        <td>{{ obj.id }}</td>
                        <td>{{ obj.mobile }}</td>
                        <td>{{ obj.price }}</td>
                        <td>{{ obj.get_level_display }}</td>
                        <td>{{ obj.get_status_display }}</td>
                        <td>
                            <a class="btn btn-primary btn-xs" style="margin-right: 5px"
                               href="/pretty/{{ obj.id }}/edit/">编辑</a>
                            <a class="btn btn-danger btn-xs" href="/pretty/{{ obj.id }}/delete/">删除</a>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
        </div>

        <ul class="pagination">
            {{ page_string }}
        </ul>

    </div>
{% endblock %}